#include <stdio.h>
double inner_product(double a[], double b[], int n) {
    double res = 0.0;
    for (int i = 0; i < n; i++) {
        res += a[i] * b[i];
    }
    return res;
}
int main(void)
{
    double a[] = {1, 2, 3, 4, 5};
    double b[] = {1, 2, 3, 4, 5};
    printf("%f\n", inner_product(a, b, sizeof(a) / sizeof(a[0])));
    return 0;
}